<template>
	<view class="content">
		<!-- <view class="line">
			<view class="input-label">门店名称</view>
			<view>
				<input type="text" v-model="storeName" class="input-field" placeholder="请输入"/>
			</view>
		</view> -->
		<!-- <view class="line">
			<view class="input-label">门店名称</view>
			<view @click="getLocation">
				<view class="areaName" >{{areaName?areaName:'点击选择'}}</view>
			</view>
		</view> -->
		<!-- <view class="line">
			<view class="input-label">门店位置</view>
			<view>
				<input type="text" v-model="storeAddr" class="input-field" placeholder="请输入"/>
			</view>
		</view>
		<view class="line">
			<view class="input-label">详细地址</view>
			<view>
				<input class="input-field" v-model="address" type="text" placeholder="请输入"/>
			</view>
		</view>
		<view class="line">
			<view class="input-label">联系人</view>
			<view>
				<input class="input-field" v-model="name" type="text" placeholder="请输入"/>
			</view>
		</view>
		<view class="line">
			<view class="input-label">联系电话</view>
			<view>
				<input class="input-field" v-model="phone" type="text" placeholder="请输入"/>
			</view>
		</view>
		<view class="line">
			<view class="input-label">门店需求</view>
			<view>
				<input class="input-field" v-model="brand" type="text" placeholder="请输入"/>
			</view>
		</view>
		<view class="submit" @click="submit">提交</view> -->
		<view>暂未开放，敬请期待</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				areaName:'',
				latitude:'',
				longitude :'',
				storeName:'',
				storeAddr:'',
				address:'',
				name:'',
				phone:'',
				brand:'',
				userInfo:'',
			}
		},
		onLoad() {
           this.userInfo= uni.getStorageSync("userInfo")
		},
		methods: {
			submit(){
				if(!this.storeName){
					uni.showToast({
					 title: "请填写门店名称",
					 icon:'none',
					 duration: 3000
					});
					return false
				}
				if(!this.storeAddr){
					uni.showToast({
					 title: "请填写门店位置",
					 icon:'none',
					 duration: 3000
					});
					return false
				}
				if(!this.address){
					uni.showToast({
					 title: "请填写门店详细地址",
					 icon:'none',
					 duration: 3000
					});
					return false
				}
				if(!this.name){
					uni.showToast({
					 title: "请填写申请人",
					 icon:'none',
					 duration: 3000
					});
					return false
				}
				if(!this.phone){
					uni.showToast({
					 title: "请填写联系电话",
					 icon:'none',
					 duration: 3000
					});
					return false
				}
				uni.showLoading({
					title: '加载中'
				})
				this.$http('jeecg-boot/app/market/bicBusinessesApplyInfo/add',{
					     userId:this.userInfo.id,
						 storeName:this.storeName,
						 storeAddr:this.storeAddr,
						 address:this.address,
						 name:this.name,
						 phone:this.phone,
						 brand:this.brand,
				},'POST').then(res => {
					  uni.hideLoading();
					  if(res.success){
						  uni.showToast({
						   title: "提交完成",
						   icon:'none',
						   duration: 3000
						  });
						 
					  }
				})
			},
            getLocation(){
				/* uni.getLocation({
					type: 'gcj02', //返回可以用于uni.openLocation的经纬度
					success: function (res) {
						const latitude = res.latitude;
						const longitude = res.longitude;
						uni.openLocation({
							latitude: latitude,
							longitude: longitude,
							success: function () {
								console.log('success');
							}
						});	
					}
				}); */
			/* 	uni.chooseLocation({
				  success: function (location) {
				    console.log('位置名称：' + location.name);
				    console.log('纬度：' + location.latitude);
				    console.log('经度：' + location.longitude);
				    // 使用选择的地点进行后续操作，例如标记或导航到该地点
				    uni.openLocation({
				      latitude: location.latitude,
				      longitude: location.longitude,
				      name: location.name, // 地点名称，非必须参数，用于展示在地图上的标记点名称
				      address: location.address, // 详细地址，非必须参数，用于展示在地图上的标记点详细地址信息
				      scale: 18 // 缩放比例，非必须参数，默认18，用于展示地图的缩放级别。取值范围为5-18，数值越大，地图显示越详细。
				    });
				  },
				  fail: function (err) {
					console.log(err)
				    uni.showToast({
				      title: '选择位置失败',
				      icon: 'none'
				    });
				  }
				}); */
			}
		}
	}
</script>

<style>
	
	.submit{
		width: 650rpx;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		background: #3F90F7;
		color: #ffffff;
		font-size: 30rpx;
		border-radius: 10rpx;
		position: fixed;
		bottom: 100rpx;
		left: 50rpx;
	}
	.line{
		display: flex;
		padding: 30rpx 20rpx;
		border-bottom: 1px solid #eee;
		color: #333333;
	}
	.input-field{
		padding-left: 50rpx;
	}
	.input-label{
		width: 150rpx;
	}
	.areaName{
		padding-left: 50rpx;
		color: #333;
	}
</style>
